package com.foreknow.demo03;

/**
 * 定义一个数组并计算平均值
 */
public class ArrayDemo2 {
  public static void main(String[] args) {
    int[] array = {12,34,56,14,25,89,65};
    int sum = 0;//求和
    for(int i = 0;i< array.length;i++){
      sum+=array[i];
    }
    int avg = sum/array.length;
    System.out.println(avg);

  }
}
